package com.wdf.dota;



import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

import com.wdf.bean.DotaHeros;
import com.wdf.bean.Meta;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.Log;
import android.view.View;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.Button;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;

public class DotaHeroMenuActivity extends Activity implements OnCheckedChangeListener{
	private RadioGroup mRadioGroup;
	private RadioButton mRadioButton1;
	private RadioButton mRadioButton2;
	private RadioButton mRadioButton3;



	private float mCurrentCheckedRadioLeft;//当前被选中的RadioButton距离左侧的距离
	private HorizontalScrollView mHorizontalScrollView;//上面的水平滚动控件
	private ViewPager mViewPager;	//下方的可横向拖动的控件
	private ArrayList<View> mViews;//用来存放下方滚动的layout(layout_1,layout_2,layout_3)
	
	private Bundle bundle;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dota_hero_menu);
        
        iniController();
        iniListener();
        iniVariable();
        
        mRadioButton1.setChecked(true);
        mViewPager.setCurrentItem(1);
        mCurrentCheckedRadioLeft = getCurrentCheckedRadioLeft();
        

        initHero();
    }
    public void initHero(){
    	String[] herosStrength = DotaHeros.dotaHeros_Strength;
   	 for(String hero : herosStrength){
   		 int resID = getResources().getIdentifier(hero, "id", "com.wdf.dota"); 
   		 ImageView view = (ImageView)mViews.get(1).findViewById(resID);
   		 InputStream fis;
			try {
				fis = getAssets().open( "dota/"+hero +".png");
				Bitmap bm = BitmapFactory.decodeStream(fis);
				  view.setImageBitmap(bm);
			} catch (IOException e) {
				e.printStackTrace();
			}
   	 }
   	 String[] herosAgile = DotaHeros.dotaHeros_Agile;
   	 for(String hero : herosAgile){
   		 int resID = getResources().getIdentifier(hero, "id", "com.wdf.dota"); 
   		 ImageView view = (ImageView)mViews.get(2).findViewById(resID);
   		 InputStream fis;
			try {
				fis = getAssets().open( "dota/"+hero +".png");
				Bitmap bm = BitmapFactory.decodeStream(fis);
				view.setImageBitmap(bm);
			} catch (IOException e) {
				e.printStackTrace();
			}
   	 }
   	 String[] herosIntelgence = DotaHeros.dotaHeros_Intelgence;
   	 for(String hero : herosIntelgence){
   		 int resID = getResources().getIdentifier(hero, "id", "com.wdf.dota"); 
   		 ImageView view = (ImageView)mViews.get(3).findViewById(resID);
   		 InputStream fis;
			try {
				fis = getAssets().open( "dota/"+hero +".png");
				Bitmap bm = BitmapFactory.decodeStream(fis);
				  view.setImageBitmap(bm);
			} catch (IOException e) {
				e.printStackTrace();
			}
   	 }
    }
    private void iniVariable() {
		// TODO Auto-generated method stub
    	mViews = new ArrayList<View>();
    	mViews.add(getLayoutInflater().inflate(R.layout.dota_hero_menu0, null));
    	mViews.add(getLayoutInflater().inflate(R.layout.dota_hero_menu1, null));
    	mViews.add(getLayoutInflater().inflate(R.layout.dota_hero_menu2, null));
    	mViews.add(getLayoutInflater().inflate(R.layout.dota_hero_menu3, null));
    
    	
    	mViewPager.setAdapter(new MyPagerAdapter());//设置ViewPager的适配器
	}
    
    /**
	 * RadioGroup点击CheckedChanged监听
	 */
	@Override
	public void onCheckedChanged(RadioGroup group, int checkedId) {
		
		AnimationSet _AnimationSet = new AnimationSet(true);
		TranslateAnimation _TranslateAnimation;
		

		if (checkedId == R.id.btn1) {
			_TranslateAnimation = new TranslateAnimation(mCurrentCheckedRadioLeft, getResources().getDimension(R.dimen.rdo1), 0f, 0f);
			_AnimationSet.addAnimation(_TranslateAnimation);
			_AnimationSet.setFillBefore(false);
			_AnimationSet.setFillAfter(true);
			_AnimationSet.setDuration(100);

			mViewPager.setCurrentItem(1);//让下方ViewPager跟随上面的HorizontalScrollView切换
		}else if (checkedId == R.id.btn2) {
			_TranslateAnimation = new TranslateAnimation(mCurrentCheckedRadioLeft, getResources().getDimension(R.dimen.rdo2), 0f, 0f);

			_AnimationSet.addAnimation(_TranslateAnimation);
			_AnimationSet.setFillBefore(false);
			_AnimationSet.setFillAfter(true);
			_AnimationSet.setDuration(100);

		
	
			
			mViewPager.setCurrentItem(2);
		}else if (checkedId == R.id.btn3) {
			_TranslateAnimation = new TranslateAnimation(mCurrentCheckedRadioLeft, getResources().getDimension(R.dimen.rdo3), 0f, 0f);
			
			_AnimationSet.addAnimation(_TranslateAnimation);
			_AnimationSet.setFillBefore(false);
			_AnimationSet.setFillAfter(true);
			_AnimationSet.setDuration(100);
			
		
	
			
			mViewPager.setCurrentItem(3);
		}
		
		mCurrentCheckedRadioLeft = getCurrentCheckedRadioLeft();//更新当前蓝色横条距离左边的距离
		
		Log.i("zj", "getCurrentCheckedRadioLeft="+getCurrentCheckedRadioLeft());
		Log.i("zj", "getDimension="+getResources().getDimension(R.dimen.rdo2));
		
		mHorizontalScrollView.smoothScrollTo((int)mCurrentCheckedRadioLeft-(int)getResources().getDimension(R.dimen.rdo2), 0);
	}
    
	/**
     * 获得当前被选中的RadioButton距离左侧的距离
     */
	private float getCurrentCheckedRadioLeft() {
		// TODO Auto-generated method stub
		if (mRadioButton1.isChecked()) {
			//Log.i("zj", "currentCheckedRadioLeft="+getResources().getDimension(R.dimen.rdo1));
			return getResources().getDimension(R.dimen.rdo1);
		}else if (mRadioButton2.isChecked()) {
			//Log.i("zj", "currentCheckedRadioLeft="+getResources().getDimension(R.dimen.rdo2));
			return getResources().getDimension(R.dimen.rdo2);
		}else if (mRadioButton3.isChecked()) {
			//Log.i("zj", "currentCheckedRadioLeft="+getResources().getDimension(R.dimen.rdo3));
			return getResources().getDimension(R.dimen.rdo3);
		}
		return 0f;
	}

	private void iniListener() {
		// TODO Auto-generated method stub
		
		mRadioGroup.setOnCheckedChangeListener(this);
		
		
		mViewPager.setOnPageChangeListener(new MyPagerOnPageChangeListener());
	}

	private void iniController() {
		// TODO Auto-generated method stub
		mRadioGroup = (RadioGroup)findViewById(R.id.radioGroup);
		mRadioButton1 = (RadioButton)findViewById(R.id.btn1);
		mRadioButton2 = (RadioButton)findViewById(R.id.btn2);
		mRadioButton3 = (RadioButton)findViewById(R.id.btn3);

		

		
		mHorizontalScrollView = (HorizontalScrollView)findViewById(R.id.horizontalScrollView);
		
		mViewPager = (ViewPager)findViewById(R.id.pager);
	}

	/**
	 * ViewPager的适配器
	 * @author zj
	 * 2012-5-24 下午2:26:57
	 */
	private class MyPagerAdapter extends PagerAdapter{

		@Override
		public void destroyItem(View v, int position, Object obj) {
			// TODO Auto-generated method stub
			((ViewPager)v).removeView(mViews.get(position));
		}

		@Override
		public void finishUpdate(View arg0) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public int getCount() {
			// TODO Auto-generated method stub
			return mViews.size();
		}

		@Override
		public Object instantiateItem(View v, int position) {
			((ViewPager)v).addView(mViews.get(position));
			return mViews.get(position);
		}

		@Override
		public boolean isViewFromObject(View arg0, Object arg1) {
			// TODO Auto-generated method stub
			return arg0 == arg1;
		}

		@Override
		public void restoreState(Parcelable arg0, ClassLoader arg1) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public Parcelable saveState() {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public void startUpdate(View arg0) {
			// TODO Auto-generated method stub
			
		}
		
	}
	/**
	 * ViewPager的PageChangeListener(页面改变的监听器)
	 * @author zj
	 * 2012-5-24 下午3:14:27
	 */
	private class MyPagerOnPageChangeListener implements OnPageChangeListener{

		@Override
		public void onPageScrollStateChanged(int arg0) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void onPageScrolled(int arg0, float arg1, int arg2) {
			// TODO Auto-generated method stub
			
		}
		/**
		 * 滑动ViewPager的时候,让上方的HorizontalScrollView自动切换
		 */
		@Override
		public void onPageSelected(int position) {
			// TODO Auto-generated method stub
			//Log.i("zj", "position="+position);
			
			if (position == 0) {
				mViewPager.setCurrentItem(1);
			}else if (position == 1) {
				mRadioButton1.performClick();
			}else if (position == 2) {
				mRadioButton2.performClick();
			}else if (position == 3) {
				mRadioButton3.performClick();
			}else if (position == 4) {
				mViewPager.setCurrentItem(3);
			}
		}
		
	}
	
	public void myHandler(View target) {
		bundle = new Bundle();
		Intent intent;

		intent = new Intent(this, ViewActivity.class);

		
		String heroname = "";
		String herodescription="";
		
		String heroprop="";
		
		String skill1="";
		String skill2="";
		String skill3="";
		String skill4="";
		String modinfo="<font color=red></font><br>";
		switch (target.getId()) {
	
		case R.id.abaddon:heroname = "abaddon";herodescription= Meta.abaddon;skill1=Meta.abaddon_1;skill2= Meta.abaddon_2;skill3 =Meta.abaddon_3;skill4 =Meta.abaddon_4;heroprop=Meta.abaddon_prop;modinfo=Meta.abaddon_678modinfo;break;
		case R.id.aggronstonebreaker:heroname = "aggronstonebreaker";herodescription= Meta.aggronstonebreaker;skill1=Meta.aggronstonebreaker_1;skill2= Meta.aggronstonebreaker_2;skill3 =Meta.aggronstonebreaker_3;skill4 =Meta.aggronstonebreaker_4;heroprop=Meta.aggronstonebreaker_prop;modinfo=Meta.aggronstonebreaker_678modinfo;break;
		case R.id.aiushtha:heroname = "aiushtha";herodescription= Meta.aiushtha;skill1=Meta.aiushtha_1;skill2= Meta.aiushtha_2;skill3 =Meta.aiushtha_3;skill4 =Meta.aiushtha_4;heroprop=Meta.aiushtha_prop;modinfo=Meta.aiushtha_678modinfo;break;
		case R.id.akash:heroname = "akash";herodescription= Meta.akash;skill1=Meta.akash_1;skill2= Meta.akash_2;skill3 =Meta.akash_3;skill4 =Meta.akash_4;heroprop=Meta.akash_prop; modinfo=Meta.akash_678modinfo;break;
		case R.id.alleria:heroname = "alleria";herodescription= Meta.alleria;skill1=Meta.alleria_1;skill2= Meta.alleria_2;skill3 =Meta.alleria_3;skill4 =Meta.alleria_4;heroprop=Meta.alleria_prop;break;
		case R.id.ancientapparition:heroname = "ancientapparition";herodescription= Meta.ancientapparition;skill1=Meta.ancientapparition_1;skill2= Meta.ancientapparition_2;skill3 =Meta.ancientapparition_3;skill4 =Meta.ancientapparition_4;heroprop=Meta.ancientapparition_prop;modinfo=Meta.ancientapparition_678modinfo;break;
		case R.id.anubarak:heroname = "anubarak";herodescription= Meta.anubarak;skill1=Meta.anubarak_1;skill2= Meta.anubarak_2;skill3 =Meta.anubarak_3;skill4 =Meta.anubarak_4;heroprop=Meta.anubarak_prop;modinfo=Meta.anubarak_678modinfo;break;
		case R.id.anubseran:heroname = "anubseran";herodescription= Meta.anubseran;skill1=Meta.anubseran_1;skill2= Meta.anubseran_2;skill3 =Meta.anubseran_3;skill4 =Meta.anubseran_4;heroprop=Meta.anubseran_prop;break;
		case R.id.atropos:heroname = "atropos";herodescription= Meta.atropos;skill1=Meta.atropos_1;skill2= Meta.atropos_2;skill3 =Meta.atropos_3;skill4 =Meta.atropos_4;heroprop=Meta.atropos_prop;break;
		case R.id.aurelvlaicu:heroname = "aurelvlaicu";herodescription= Meta.aurelvlaicu;skill1=Meta.aurelvlaicu_1;skill2= Meta.aurelvlaicu_2;skill3 =Meta.aurelvlaicu_3;skill4 =Meta.aurelvlaicu_4;heroprop=Meta.aurelvlaicu_prop;modinfo=Meta.aurelvlaicu_678modinfo;break;
		case R.id.auroth:heroname = "auroth";herodescription= Meta.auroth;skill1=Meta.auroth_1;skill2= Meta.auroth_2;skill3=Meta.auroth_3;skill4=Meta.auroth_4;heroprop=Meta.auroth_prop;break;
		case R.id.azgalor:heroname = "azgalor";herodescription= Meta.azgalor;skill1=Meta.azgalor_1;skill2= Meta.azgalor_2;skill3 =Meta.azgalor_3;skill4 =Meta.azgalor_4;heroprop=Meta.azgalor_prop;break;
		case R.id.azwraith:heroname = "azwraith";herodescription= Meta.azwraith;skill1=Meta.azwraith_1;skill2= Meta.azwraith_2;skill3 =Meta.azwraith_3;skill4 =Meta.azwraith_4;heroprop=Meta.azwraith_prop;modinfo=Meta.azwraith_678modinfo;break;
		case R.id.balanar:heroname = "balanar";herodescription= Meta.balanar;skill1=Meta.balanar_1;skill2= Meta.balanar_2;skill3 =Meta.balanar_3;skill4 =Meta.balanar_4;heroprop=Meta.balanar_prop;modinfo=Meta.balanar_678modinfo;break;
		case R.id.banehallow:heroname = "banehallow";herodescription= Meta.banehallow;skill1=Meta.banehallow_1;skill2= Meta.banehallow_2;skill3 =Meta.banehallow_3;skill4 =Meta.banehallow_4;heroprop=Meta.banehallow_prop;modinfo=Meta.banehallow_678modinfo;break;
		case R.id.barathrum:heroname = "barathrum";herodescription= Meta.barathrum;skill1=Meta.barathrum_1;skill2= Meta.barathrum_2;skill3 =Meta.barathrum_3;skill4 =Meta.barathrum_4;heroprop=Meta.barathrum_prop;modinfo=Meta.barathrum_678modinfo;break;
		case R.id.batrider:heroname = "batrider";herodescription= Meta.batrider;skill1=Meta.batrider_1;skill2= Meta.batrider_2;skill3 =Meta.batrider_3;skill4 =Meta.batrider_4;heroprop=Meta.batrider_prop;modinfo=Meta.batrider_678modinfo;break;
		case R.id.blackarachnia:heroname = "blackarachnia";herodescription= Meta.blackarachnia;skill1=Meta.blackarachnia_1;skill2= Meta.blackarachnia_2;skill3 =Meta.blackarachnia_3;skill4 =Meta.blackarachnia_4;heroprop=Meta.blackarachnia_prop;modinfo=Meta.blackarachnia_678modinfo;break;
		case R.id.boush:heroname = "boush";herodescription= Meta.boush;skill1=Meta.boush_1;skill2= Meta.boush_2;skill3 =Meta.boush_3;skill4 =Meta.boush_4;heroprop=Meta.boush_prop;break;
		case R.id.bradwarden:heroname = "bradwarden";herodescription= Meta.bradwarden;skill1=Meta.bradwarden_1;skill2= Meta.bradwarden_2;skill3 =Meta.bradwarden_3;skill4 =Meta.bradwarden_4;heroprop=Meta.bradwarden_prop;modinfo=Meta.bradwarden_678modinfo;break;
		case R.id.chen:heroname = "chen";herodescription= Meta.chen;skill1=Meta.chen_1;skill2= Meta.chen_2;skill3 =Meta.chen_3;skill4 =Meta.chen_4;heroprop=Meta.chen_prop;modinfo=Meta.chen_678modinfo;break;
		case R.id.clinkz:heroname = "clinkz";herodescription= Meta.clinkz;skill1=Meta.clinkz_1;skill2= Meta.clinkz_2;skill3 =Meta.clinkz_3;skill4 =Meta.clinkz_4;heroprop=Meta.clinkz_prop;modinfo=Meta.clinkz_678modinfo;break;
		case R.id.crixalis:heroname = "crixalis";herodescription= Meta.crixalis;skill1=Meta.crixalis_1;skill2= Meta.crixalis_2;skill3 =Meta.crixalis_3;skill4 =Meta.crixalis_4;heroprop=Meta.crixalis_prop;break;
		case R.id.darchrow:heroname = "darchrow";herodescription= Meta.darchrow;skill1=Meta.darchrow_1;skill2= Meta.darchrow_2;skill3 =Meta.darchrow_3;skill4 =Meta.darchrow_4;heroprop=Meta.darchrow_prop;modinfo=Meta.darchrow_678modinfo;break;
		case R.id.darkterror:heroname = "darkterror";herodescription= Meta.darkterror;skill1=Meta.darkterror_1;skill2= Meta.darkterror_2;skill3 =Meta.darkterror_3;skill4 =Meta.darkterror_4;heroprop=Meta.darkterror_prop; modinfo=Meta.darkterror_678modinfo;break;
		case R.id.dazzle:heroname = "dazzle";herodescription= Meta.dazzle;skill1=Meta.dazzle_1;skill2= Meta.dazzle_2;skill3 =Meta.dazzle_3;skill4 =Meta.dazzle_4;heroprop=Meta.dazzle_prop;modinfo=Meta.dazzle_678modinfo;break;
		case R.id.demnoklannik:heroname = "demnoklannik";herodescription= Meta.demnoklannik;skill1=Meta.demnoklannik_1;skill2= Meta.demnoklannik_2;skill3 =Meta.demnoklannik_3;skill4 =Meta.demnoklannik_4;heroprop=Meta.demnoklannik_prop;break;
		case R.id.dirge:heroname = "dirge";herodescription= Meta.dirge;skill1=Meta.dirge_1;skill2= Meta.dirge_2;skill3 =Meta.dirge_3;skill4 =Meta.dirge_4;heroprop=Meta.dirge_prop;modinfo=Meta.dirge_678modinfo;break;
		case R.id.earthspirit:heroname = "earthspirit";herodescription= Meta.earthspirit;skill1=Meta.earthspirit_1;skill2= Meta.earthspirit_2;skill3 =Meta.earthspirit_3;skill4 =Meta.earthspirit_4;heroprop=Meta.earthspirit_prop;modinfo=Meta.earthspirit_678modinfo;break;
		case R.id.emberspirit:heroname = "emberspirit";herodescription= Meta.emberspirit;skill1=Meta.emberspirit_1;skill2= Meta.emberspirit_2;skill3 =Meta.emberspirit_3;skill4 =Meta.emberspirit_4;heroprop=Meta.emberspirit_prop;modinfo=Meta.emberspirit_678modinfo;break;
		case R.id.eredar:heroname = "eredar";herodescription= Meta.eredar;skill1=Meta.eredar_1;skill2= Meta.eredar_2;skill3 =Meta.eredar_3;skill4 =Meta.eredar_4;heroprop=Meta.eredar_prop;modinfo=Meta.eredar_678modinfo;break;
		case R.id.ezalor:heroname = "ezalor";herodescription= Meta.ezalor;skill1=Meta.ezalor_1;skill2= Meta.ezalor_2;skill3 =Meta.ezalor_3;skill4 =Meta.ezalor_4;heroprop=Meta.ezalor_prop;modinfo=Meta.ezalor_678modinfo;break;
		case R.id.furion:heroname = "furion";herodescription= Meta.furion;skill1=Meta.furion_1;skill2= Meta.furion_2;skill3 =Meta.furion_3;skill4 =Meta.furion_4;heroprop=Meta.furion_prop;modinfo=Meta.furion_678modinfo;break;
		case R.id.goblinshredder:heroname = "goblinshredder";herodescription= Meta.goblinshredder;skill1=Meta.goblinshredder_1;skill2= Meta.goblinshredder_2;skill3 =Meta.goblinshredder_3;skill4 =Meta.goblinshredder_4;heroprop=Meta.goblinshredder_prop;modinfo=Meta.goblinshredder_678modinfo;break;
		case R.id.gondar:heroname = "gondar";herodescription= Meta.gondar;skill1=Meta.gondar_1;skill2= Meta.gondar_2;skill3 =Meta.gondar_3;skill4 =Meta.gondar_4;heroprop=Meta.gondar_prop;modinfo=Meta.gondar_678modinfo;break;
		case R.id.guardianwisp:heroname = "guardianwisp";herodescription= Meta.guardianwisp;skill1=Meta.guardianwisp_1;skill2= Meta.guardianwisp_2;skill3 =Meta.guardianwisp_3;skill4 =Meta.guardianwisp_4;heroprop=Meta.guardianwisp_prop;modinfo=Meta.guardianwisp_678modinfo;break;
		case R.id.harbinger:heroname = "harbinger";herodescription= Meta.harbinger;skill1=Meta.harbinger_1;skill2= Meta.harbinger_2;skill3 =Meta.harbinger_3;skill4 =Meta.harbinger_4;heroprop=Meta.harbinger_prop;modinfo=Meta.harbinger_678modinfo;break;
		case R.id.huskar:heroname = "huskar";herodescription= Meta.huskar;skill1=Meta.huskar_1;skill2= Meta.huskar_2;skill3 =Meta.huskar_3;skill4 =Meta.huskar_4;heroprop=Meta.huskar_prop;modinfo=Meta.huskar_678modinfo;break;
		case R.id.ishkafei:heroname = "ishkafei";herodescription= Meta.ishkafei;skill1=Meta.ishkafei_1;skill2= Meta.ishkafei_2;skill3 =Meta.ishkafei_3;skill4 =Meta.ishkafei_4;heroprop=Meta.ishkafei_prop;modinfo=Meta.ishkafei_678modinfo;break;
		case R.id.jahrakal:heroname = "jahrakal";herodescription= Meta.jahrakal;skill1=Meta.jahrakal_1;skill2= Meta.jahrakal_2;skill3 =Meta.jahrakal_3;skill4 =Meta.jahrakal_4;heroprop=Meta.jahrakal_prop;modinfo=Meta.jahrakal_678modinfo;break;
		case R.id.jakiro:heroname = "jakiro";herodescription= Meta.jakiro;skill1=Meta.jakiro_1;skill2= Meta.jakiro_2;skill3 =Meta.jakiro_3;skill4 =Meta.jakiro_4;heroprop=Meta.jakiro_prop;   modinfo=Meta.jakiro_678modinfo;break;
		case R.id.kael:heroname = "kael";herodescription= Meta.kael;skill1=Meta.kael_1;skill2= Meta.kael_2;skill3 =Meta.kael_3;skill4 =Meta.kael_4;heroprop=Meta.kael_prop;modinfo=Meta.kael_678modinfo;break;
		case R.id.kardelsharpeye:heroname = "kardelsharpeye";herodescription= Meta.kardelsharpeye;skill1=Meta.kardelsharpeye_1;skill2= Meta.kardelsharpeye_2;skill3 =Meta.kardelsharpeye_3;skill4 =Meta.kardelsharpeye_4;heroprop=Meta.kardelsharpeye_prop;modinfo=Meta.kardelsharpeye_678modinfo;break;
		case R.id.kelthuzad:heroname = "kelthuzad";herodescription= Meta.kelthuzad;skill1=Meta.kelthuzad_1;skill2= Meta.kelthuzad_2;skill3 =Meta.kelthuzad_3;skill4 =Meta.kelthuzad_4;heroprop=Meta.kelthuzad_prop;modinfo=Meta.kelthuzad_678modinfo;break;
		case R.id.kingleoric:heroname = "kingleoric";herodescription= Meta.kingleoric;skill1=Meta.kingleoric_1;skill2= Meta.kingleoric_2;skill3 =Meta.kingleoric_3;skill4 =Meta.kingleoric_4;heroprop=Meta.kingleoric_prop;modinfo=Meta.kingleoric_678modinfo;break;
		case R.id.knightdavion:heroname = "knightdavion";herodescription= Meta.knightdavion;skill1=Meta.knightdavion_1;skill2= Meta.knightdavion_2;skill3 =Meta.knightdavion_3;skill4 =Meta.knightdavion_4;heroprop=Meta.knightdavion_prop;modinfo=Meta.knightdavion_678modinfo;break;
		case R.id.krobelu:heroname = "krobelu";herodescription= Meta.krobelu;skill1=Meta.krobelu_1;skill2= Meta.krobelu_2;skill3 =Meta.krobelu_3;skill4 =Meta.krobelu_4;heroprop=Meta.krobelu_prop;modinfo=Meta.krobelu_678modinfo;break;
		case R.id.kunkka:heroname = "kunkka";herodescription= Meta.kunkka;skill1=Meta.kunkka_1;skill2= Meta.kunkka_2;skill3 =Meta.kunkka_3;skill4 =Meta.kunkka_4;heroprop=Meta.kunkka_prop;modinfo=Meta.kunkka_678modinfo;break;
		case R.id.legioncommander:heroname = "legioncommander";herodescription= Meta.legioncommander;skill1=Meta.legioncommander_1;skill2= Meta.legioncommander_2;skill3 =Meta.legioncommander_3;skill4 =Meta.legioncommander_4;heroprop=Meta.legioncommander_prop;modinfo=Meta.legioncommander_678modinfo;break;
		case R.id.lesaledeathbringer:heroname = "lesaledeathbringer";herodescription= Meta.lesaledeathbringer;skill1=Meta.lesaledeathbringer_1;skill2= Meta.lesaledeathbringer_2;skill3 =Meta.lesaledeathbringer_3;skill4 =Meta.lesaledeathbringer_4;heroprop=Meta.lesaledeathbringer_prop;modinfo=Meta.lesaledeathbringer_678modinfo; break;
		case R.id.leshracthemalicious:heroname = "leshracthemalicious";herodescription= Meta.leshracthemalicious;skill1=Meta.leshracthemalicious_1;skill2= Meta.leshracthemalicious_2;skill3 =Meta.leshracthemalicious_3;skill4 =Meta.leshracthemalicious_4;heroprop=Meta.leshracthemalicious_prop;  modinfo=Meta.leshracthemalicious_678modinfo; break;
		case R.id.leviathan:heroname = "leviathan";herodescription= Meta.leviathan;skill1=Meta.leviathan_1;skill2= Meta.leviathan_2;skill3 =Meta.leviathan_3;skill4 =Meta.leviathan_4;heroprop=Meta.leviathan_prop;modinfo=Meta.leviathan_678modinfo;break;
		case R.id.linainverse:heroname = "linainverse";herodescription= Meta.linainverse;skill1=Meta.linainverse_1;skill2= Meta.linainverse_2;skill3 =Meta.linainverse_3;skill4 =Meta.linainverse_4;heroprop=Meta.linainverse_prop;modinfo=Meta.linainverse_678modinfo;break;
		case R.id.lion:heroname = "lion";herodescription= Meta.lion;skill1=Meta.lion_1;skill2= Meta.lion_2;skill3 =Meta.lion_3;skill4 =Meta.lion_4;heroprop=Meta.lion_prop;modinfo=Meta.lion_678modinfo;break;
		case R.id.lucifer:heroname = "lucifer";herodescription= Meta.lucifer;skill1=Meta.lucifer_1;skill2= Meta.lucifer_2;skill3 =Meta.lucifer_3;skill4 =Meta.lucifer_4;heroprop=Meta.lucifer_prop;modinfo=Meta.lucifer_678modinfo;break;
		case R.id.lunamoonfang:heroname = "lunamoonfang";herodescription= Meta.lunamoonfang;skill1=Meta.lunamoonfang_1;skill2= Meta.lunamoonfang_2;skill3 =Meta.lunamoonfang_3;skill4 =Meta.lunamoonfang_4;heroprop=Meta.lunamoonfang_prop;  modinfo=Meta.lunamoonfang_678modinfo;break;
		case R.id.lunaya:heroname = "lunaya";herodescription= Meta.lunaya;skill1=Meta.lunaya_1;skill2= Meta.lunaya_2;skill3 =Meta.lunaya_3;skill4 =Meta.lunaya_4;heroprop=Meta.lunaya_prop;break;
		case R.id.magina:heroname = "magina";herodescription= Meta.magina;skill1=Meta.magina_1;skill2= Meta.magina_2;skill3 =Meta.magina_3;skill4 =Meta.magina_4;heroprop=Meta.magina_prop;break;
		case R.id.magnus:heroname = "magnus";herodescription= Meta.magnus;skill1=Meta.magnus_1;skill2= Meta.magnus_2;skill3 =Meta.magnus_3;skill4 =Meta.magnus_4;heroprop=Meta.magnus_prop;modinfo=Meta.magnus_678modinfo;break;
		case R.id.mangix:heroname = "mangix";herodescription= Meta.mangix;skill1=Meta.mangix_1;skill2= Meta.mangix_2;skill3 =Meta.mangix_3;skill4 =Meta.mangix_4;heroprop=Meta.mangix_prop;modinfo=Meta.mangix_678modinfo;break;
		case R.id.medusa:heroname = "medusa";herodescription= Meta.medusa;skill1=Meta.medusa_1;skill2= Meta.medusa_2;skill3 =Meta.medusa_3;skill4 =Meta.medusa_4;heroprop=Meta.medusa_prop;modinfo=Meta.medusa_678modinfo;break;
		case R.id.meepo:heroname = "meepo";herodescription= Meta.meepo;skill1=Meta.meepo_1;skill2= Meta.meepo_2;skill3 =Meta.meepo_3;skill4 =Meta.meepo_4;heroprop=Meta.meepo_prop;modinfo=Meta.meepo_678modinfo;break;
		case R.id.mercurial:heroname = "mercurial";herodescription= Meta.mercurial;skill1=Meta.mercurial_1;skill2= Meta.mercurial_2;skill3 =Meta.mercurial_3;skill4 =Meta.mercurial_4;heroprop=Meta.mercurial_prop; modinfo=Meta.mercurial_678modinfo;break;
		case R.id.mirananightshade:heroname = "mirananightshade";herodescription= Meta.mirananightshade;skill1=Meta.mirananightshade_1;skill2= Meta.mirananightshade_2;skill3 =Meta.mirananightshade_3;skill4 =Meta.mirananightshade_4;heroprop=Meta.mirananightshade_prop;modinfo=Meta.mirananightshade_678modinfo;break;
		case R.id.mogulkahn:heroname = "mogulkahn";herodescription= Meta.mogulkahn;skill1=Meta.mogulkahn_1;skill2= Meta.mogulkahn_2;skill3 =Meta.mogulkahn_3;skill4 =Meta.mogulkahn_4;heroprop=Meta.mogulkahn_prop;modinfo=Meta.mogulkahn_678modinfo;break;
		case R.id.morphling:heroname = "morphling";herodescription= Meta.morphling;skill1=Meta.morphling_1;skill2= Meta.morphling_2;skill3 =Meta.morphling_3;skill4 =Meta.morphling_4;heroprop=Meta.morphling_prop;modinfo=Meta.morphling_678modinfo;break;
		case R.id.mortred:heroname = "mortred";herodescription= Meta.mortred;skill1=Meta.mortred_1;skill2= Meta.mortred_2;skill3 =Meta.mortred_3;skill4 =Meta.mortred_4;heroprop=Meta.mortred_prop;modinfo=Meta.mortred_678modinfo;break;
		case R.id.naix:heroname = "naix";herodescription= Meta.naix;skill1=Meta.naix_1;skill2= Meta.naix_2;skill3 =Meta.naix_3;skill4 =Meta.naix_4;heroprop=Meta.naix_prop;modinfo=Meta.naix_678modinfo;break;
		case R.id.nessaj:heroname = "nessaj";herodescription= Meta.nessaj;skill1=Meta.nessaj_1;skill2= Meta.nessaj_2;skill3 =Meta.nessaj_3;skill4 =Meta.nessaj_4;heroprop=Meta.nessaj_prop;modinfo=Meta.nessaj_678modinfo; break;
		case R.id.nevermore:heroname = "nevermore";herodescription= Meta.nevermore;skill1=Meta.nevermore_1;skill2= Meta.nevermore_2;skill3 =Meta.nevermore_3;skill4 =Meta.nevermore_4;heroprop=Meta.nevermore_prop;modinfo=Meta.nevermore_678modinfo;break;
		case R.id.nightcrawler:heroname = "nightcrawler";herodescription= Meta.nightcrawler;skill1=Meta.nightcrawler_1;skill2= Meta.nightcrawler_2;skill3 =Meta.nightcrawler_3;skill4 =Meta.nightcrawler_4;heroprop=Meta.nightcrawler_prop;modinfo=Meta.nightcrawler_678modinfo; break;
		case R.id.nortrom:heroname = "nortrom";herodescription= Meta.nortrom;skill1=Meta.nortrom_1;skill2= Meta.nortrom_2;skill3 =Meta.nortrom_3;skill4 =Meta.nortrom_4;heroprop=Meta.nortrom_prop;modinfo=Meta.nortrom_678modinfo;break;
		case R.id.phoenix:heroname = "phoenix";herodescription= Meta.phoenix;skill1=Meta.phoenix_1;skill2= Meta.phoenix_2;skill3 =Meta.phoenix_3;skill4 =Meta.phoenix_4;heroprop=Meta.phoenix_prop;modinfo=Meta.phoenix_678modinfo;break;
		case R.id.priest:heroname = "priest";herodescription= Meta.priest;skill1=Meta.priest_1;skill2= Meta.priest_2;skill3 =Meta.priest_3;skill4 =Meta.priest_4;heroprop=Meta.priest_prop;modinfo=Meta.priest_678modinfo;break;
		case R.id.puck:heroname = "puck";herodescription= Meta.puck;skill1=Meta.puck_1;skill2= Meta.puck_2;skill3 =Meta.puck_3;skill4 =Meta.puck_4;heroprop=Meta.puck_prop;break;
		case R.id.pudge:heroname = "pudge";herodescription= Meta.pudge;skill1=Meta.pudge_1;skill2= Meta.pudge_2;skill3 =Meta.pudge_3;skill4 =Meta.pudge_4;heroprop=Meta.pudge_prop;modinfo=Meta.pudge_678modinfo;break;
		case R.id.pugna:heroname = "pugna";herodescription= Meta.pugna;skill1=Meta.pugna_1;skill2= Meta.pugna_2;skill3 =Meta.pugna_3;skill4 =Meta.pugna_4;heroprop=Meta.pugna_prop;modinfo=Meta.pugna_678modinfo;break;
		case R.id.puristthunderwrath:heroname = "puristthunderwrath";herodescription= Meta.puristthunderwrath;skill1=Meta.puristthunderwrath_1;skill2= Meta.puristthunderwrath_2;skill3 =Meta.puristthunderwrath_3;skill4 =Meta.puristthunderwrath_4;heroprop=Meta.puristthunderwrath_prop;modinfo=Meta.puristthunderwrath_678modinfo;break;
		case R.id.raigorstonehoof:heroname = "raigorstonehoof";herodescription= Meta.raigorstonehoof;skill1=Meta.raigorstonehoof_1;skill2= Meta.raigorstonehoof_2;skill3 =Meta.raigorstonehoof_3;skill4 =Meta.raigorstonehoof_4;heroprop=Meta.raigorstonehoof_prop;modinfo=Meta.raigorstonehoof_678modinfo;break;
		case R.id.raijinthunderkeg:heroname = "raijinthunderkeg";herodescription= Meta.raijinthunderkeg;skill1=Meta.raijinthunderkeg_1;skill2= Meta.raijinthunderkeg_2;skill3 =Meta.raijinthunderkeg_3;skill4 =Meta.raijinthunderkeg_4;heroprop=Meta.raijinthunderkeg_prop;modinfo=Meta.raijinthunderkeg_678modinfo;break;
		case R.id.rattletrap:heroname = "rattletrap";herodescription= Meta.rattletrap;skill1=Meta.rattletrap_1;skill2= Meta.rattletrap_2;skill3 =Meta.rattletrap_3;skill4 =Meta.rattletrap_4;heroprop=Meta.rattletrap_prop;modinfo=Meta.rattletrap_678modinfo;break;
		case R.id.razor:heroname = "razor";herodescription= Meta.razor;skill1=Meta.razor_1;skill2= Meta.razor_2;skill3 =Meta.razor_3;skill4 =Meta.razor_4;heroprop=Meta.razor_prop;modinfo=Meta.razor_678modinfo;break;
		case R.id.razzildarkbrew:heroname = "razzildarkbrew";herodescription= Meta.razzildarkbrew;skill1=Meta.razzildarkbrew_1;skill2= Meta.razzildarkbrew_2;skill3 =Meta.razzildarkbrew_3;skill4 =Meta.razzildarkbrew_4;heroprop=Meta.razzildarkbrew_prop;modinfo=Meta.razzildarkbrew_678modinfo;break;
		case R.id.rexxar:heroname = "rexxar";herodescription= Meta.rexxar;skill1=Meta.rexxar_1;skill2= Meta.rexxar_2;skill3 =Meta.rexxar_3;skill4 =Meta.rexxar_4;heroprop=Meta.rexxar_prop;modinfo=Meta.rexxar_678modinfo;break;
		case R.id.rhasta:heroname = "rhasta";herodescription= Meta.rhasta;skill1=Meta.rhasta_1;skill2= Meta.rhasta_2;skill3 =Meta.rhasta_3;skill4 =Meta.rhasta_4;heroprop=Meta.rhasta_prop;modinfo=Meta.rhasta_678modinfo;break;
		case R.id.rigwarl:heroname = "rigwarl";herodescription= Meta.rigwarl;skill1=Meta.rigwarl_1;skill2= Meta.rigwarl_2;skill3 =Meta.rigwarl_3;skill4 =Meta.rigwarl_4;heroprop=Meta.rigwarl_prop;modinfo=Meta.rigwarl_678modinfo;break;
		case R.id.rikimaru:heroname = "rikimaru";herodescription= Meta.rikimaru;skill1=Meta.rikimaru_1;skill2= Meta.rikimaru_2;skill3 =Meta.rikimaru_3;skill4 =Meta.rikimaru_4;heroprop=Meta.rikimaru_prop;modinfo=Meta.rikimaru_678modinfo;break;
		case R.id.rooftrellen:heroname = "rooftrellen";herodescription= Meta.rooftrellen;skill1=Meta.rooftrellen_1;skill2= Meta.rooftrellen_2;skill3 =Meta.rooftrellen_3;skill4 =Meta.rooftrellen_4;heroprop=Meta.rooftrellen_prop;modinfo=Meta.rooftrellen_678modinfo;break;
		case R.id.rotundjere:heroname = "rotundjere";herodescription= Meta.rotundjere;skill1=Meta.rotundjere_1;skill2= Meta.rotundjere_2;skill3 =Meta.rotundjere_3;skill4 =Meta.rotundjere_4;heroprop=Meta.rotundjere_prop;modinfo=Meta.rotundjere_678modinfo;break;
		case R.id.rubick:heroname = "rubick";herodescription= Meta.rubick;skill1=Meta.rubick_1;skill2= Meta.rubick_2;skill3 =Meta.rubick_3;skill4 =Meta.rubick_4;heroprop=Meta.rubick_prop;modinfo=Meta.rubick_678modinfo; break;
		case R.id.rylaicrestfall:heroname = "rylaicrestfall";herodescription= Meta.rylaicrestfall;skill1=Meta.rylaicrestfall_1;skill2= Meta.rylaicrestfall_2;skill3 =Meta.rylaicrestfall_3;skill4 =Meta.rylaicrestfall_4;heroprop=Meta.rylaicrestfall_prop;modinfo=Meta.rylaicrestfall_678modinfo;break;
		case R.id.shandelzaresilkwood:heroname = "shandelzaresilkwood";herodescription= Meta.shandelzaresilkwood;skill1=Meta.shandelzaresilkwood_1;skill2= Meta.shandelzaresilkwood_2;skill3 =Meta.shandelzaresilkwood_3;skill4 =Meta.shandelzaresilkwood_4;heroprop=Meta.shandelzaresilkwood_prop;modinfo=Meta.shandelzaresilkwood_678modinfo;break;
		case R.id.skywrathmage:heroname = "skywrathmage";herodescription= Meta.skywrathmage;skill1=Meta.skywrathmage_1;skill2= Meta.skywrathmage_2;skill3 =Meta.skywrathmage_3;skill4 =Meta.skywrathmage_4;heroprop=Meta.skywrathmage_prop;modinfo=Meta.skywrathmage_678modinfo; break;
		case R.id.slardar:heroname = "slardar";herodescription= Meta.slardar;skill1=Meta.slardar_1;skill2= Meta.slardar_2;skill3 =Meta.slardar_3;skill4 =Meta.slardar_4;heroprop=Meta.slardar_prop;modinfo=Meta.slardar_678modinfo;break;
		case R.id.slithice:heroname = "slithice";herodescription= Meta.slithice;skill1=Meta.slithice_1;skill2= Meta.slithice_2;skill3 =Meta.slithice_3;skill4 =Meta.slithice_4;heroprop=Meta.slithice_prop;modinfo=Meta.slithice_678modinfo;break;
		case R.id.squeeandspleen:heroname = "squeeandspleen";herodescription= Meta.squeeandspleen;skill1=Meta.squeeandspleen_1;skill2= Meta.squeeandspleen_2;skill3 =Meta.squeeandspleen_3;skill4 =Meta.squeeandspleen_4;heroprop=Meta.squeeandspleen_prop;break;
		case R.id.strygwyr:heroname = "strygwyr";herodescription= Meta.strygwyr;skill1=Meta.strygwyr_1;skill2= Meta.strygwyr_2;skill3 =Meta.strygwyr_3;skill4 =Meta.strygwyr_4;heroprop=Meta.strygwyr_prop;modinfo=Meta.strygwyr_678modinfo;break;
		case R.id.sven:heroname = "sven";herodescription= Meta.sven;skill1=Meta.sven_1;skill2= Meta.sven_2;skill3 =Meta.sven_3;skill4 =Meta.sven_4;heroprop=Meta.sven_prop;break;
		case R.id.syllabear:heroname = "syllabear";herodescription= Meta.syllabear;skill1=Meta.syllabear_1;skill2= Meta.syllabear_2;skill3 =Meta.syllabear_3;skill4 =Meta.syllabear_4;heroprop=Meta.syllabear_prop;modinfo=Meta.syllabear_678modinfo;break;
		case R.id.taurenchieftain:heroname = "taurenchieftain";herodescription= Meta.taurenchieftain;skill1=Meta.taurenchieftain_1;skill2= Meta.taurenchieftain_2;skill3 =Meta.taurenchieftain_3;skill4 =Meta.taurenchieftain_4;heroprop=Meta.taurenchieftain_prop;modinfo=Meta.taurenchieftain_678modinfo;break;
		case R.id.terrorblade:heroname = "terrorblade";herodescription= Meta.terrorblade;skill1=Meta.terrorblade_1;skill2= Meta.terrorblade_2;skill3 =Meta.terrorblade_3;skill4 =Meta.terrorblade_4;heroprop=Meta.terrorblade_prop;modinfo=Meta.terrorblade_678modinfo;break;
		case R.id.thrall:heroname = "thrall";herodescription= Meta.thrall;skill1=Meta.thrall_1;skill2= Meta.thrall_2;skill3 =Meta.thrall_3;skill4 =Meta.thrall_4;heroprop=Meta.thrall_prop;modinfo=Meta.thrall_678modinfo;break;
		case R.id.tiny:heroname = "tiny";herodescription= Meta.tiny;skill1=Meta.tiny_1;skill2= Meta.tiny_2;skill3 =Meta.tiny_3;skill4 =Meta.tiny_4;heroprop=Meta.tiny_prop;modinfo=Meta.tiny_678modinfo;break;
		case R.id.traxex:heroname = "traxex";herodescription= Meta.traxex;skill1=Meta.traxex_1;skill2= Meta.traxex_2;skill3 =Meta.traxex_3;skill4 =Meta.traxex_4;heroprop=Meta.traxex_prop;modinfo=Meta.traxex_678modinfo;break;
		case R.id.tuskarr:heroname = "tuskarr";herodescription= Meta.tuskarr;skill1=Meta.tuskarr_1;skill2= Meta.tuskarr_2;skill3 =Meta.tuskarr_3;skill4 =Meta.tuskarr_4;heroprop=Meta.tuskarr_prop;modinfo=Meta.tuskarr_678modinfo;break;
		case R.id.ulfsaar:heroname = "ulfsaar";herodescription= Meta.ulfsaar;skill1=Meta.ulfsaar_1;skill2= Meta.ulfsaar_2;skill3 =Meta.ulfsaar_3;skill4 =Meta.ulfsaar_4;heroprop=Meta.ulfsaar_prop;modinfo=Meta.ulfsaar_678modinfo;break;
		case R.id.viper:heroname = "viper";herodescription= Meta.viper;skill1=Meta.viper_1;skill2= Meta.viper_2;skill3 =Meta.viper_3;skill4 =Meta.viper_4;heroprop=Meta.viper_prop;modinfo=Meta.viper_678modinfo;break;
		case R.id.visage:heroname = "visage";herodescription= Meta.visage;skill1=Meta.visage_1;skill2= Meta.visage_2;skill3 =Meta.visage_3;skill4 =Meta.visage_4;heroprop=Meta.visage_prop;break;
		case R.id.voljin:heroname = "voljin";herodescription= Meta.voljin;skill1=Meta.voljin_1;skill2= Meta.voljin_2;skill3 =Meta.voljin_3;skill4 =Meta.voljin_4;heroprop=Meta.voljin_prop;modinfo=Meta.voljin_678modinfo;break;
		case R.id.yurnero:heroname = "yurnero";herodescription= Meta.yurnero;skill1=Meta.yurnero_1;skill2= Meta.yurnero_2;skill3 =Meta.yurnero_3;skill4 =Meta.yurnero_4;heroprop=Meta.yurnero_prop;modinfo=Meta.yurnero_678modinfo;break;
		case R.id.zeus:heroname = "zeus";herodescription= Meta.zeus;skill1=Meta.zeus_1;skill2= Meta.zeus_2;skill3 =Meta.zeus_3;skill4 =Meta.zeus_4;heroprop=Meta.zeus_prop;break;
		case R.id.zet:heroname = "zet";herodescription=Meta.zet;skill1=Meta.zet_1;skill2=Meta.zet_2;skill3=Meta.zet_3;skill4=Meta.zet_4;heroprop=Meta.zet_prop;modinfo=Meta.zet_678modinfo;break;
			
        default:
        	heroname = "kunkka";
			herodescription= Meta.kunkka;
			skill1=Meta.kunkka_1;
			skill2= Meta.kunkka_2;
			skill3 =Meta.kunkka_3;
			skill4 =Meta.kunkka_4;
			break;
		}
		bundle.putString("heroname", heroname);
		bundle.putString("herodescription", herodescription);
		bundle.putString("heroprop", heroprop);
		bundle.putString("skill1", skill1);
		bundle.putString("skill2", skill2);
		bundle.putString("skill3", skill3);
		bundle.putString("skill4", skill4);
		bundle.putString("modinfo", modinfo);
		intent.putExtras(bundle);
		startActivityForResult(intent, 0);
	}
	
	boolean[]  mark = {false,false,false,false,false,false,false,false,false,false,false,false};
	
	
	public void handlerDisplay(View target){
		
		switch (target.getId()) {
		case R.id.pub01Btn:
		case R.id.pub01RelativeLayout:
			doAction(R.id.pub01Btn,R.id.pub01Display,0);
			break;
		case R.id.pub02Btn:
		case R.id.pub02RelativeLayout:
			doAction(R.id.pub02Btn,R.id.pub02Display,1);
			break;
		case R.id.pub03Btn:
		case R.id.pub03RelativeLayout:
			doAction(R.id.pub03Btn,R.id.pub03Display,2);
			break;
		case R.id.pub04Btn:
		case R.id.pub04RelativeLayout:
			doAction(R.id.pub04Btn,R.id.pub04Display,3);
			break;
		case R.id.pub05Btn:
		case R.id.pub05RelativeLayout:
			doAction(R.id.pub05Btn,R.id.pub05Display,4);
			break;
		case R.id.pub06Btn:
		case R.id.pub06RelativeLayout:
			doAction(R.id.pub06Btn,R.id.pub06Display,5);
			break;
		case R.id.pub07Btn:
		case R.id.pub07RelativeLayout:
			doAction(R.id.pub07Btn,R.id.pub07Display,6);
			break;
		case R.id.pub08Btn:
		case R.id.pub08RelativeLayout:
			doAction(R.id.pub08Btn,R.id.pub08Display,7);
			break;
		case R.id.pub09Btn:
		case R.id.pub09RelativeLayout:
			doAction(R.id.pub09Btn,R.id.pub09Display,8);
			break;
		case R.id.pub10Btn:
		case R.id.pub10RelativeLayout:
			doAction(R.id.pub10Btn,R.id.pub10Display,9);
			break;
		case R.id.pub11Btn:
		case R.id.pub11RelativeLayout:
			doAction(R.id.pub11Btn,R.id.pub11Display,10);
			break;
		case R.id.pub12Btn:
		case R.id.pub12RelativeLayout:
			doAction(R.id.pub12Btn,R.id.pub12Display,11);
			break;
		}
		
	}
	
	public void doAction(int btn,int display,int index){
		Drawable  up = getResources().getDrawable(R.drawable.ud_switch_u_btn_n);
		Drawable  down = getResources().getDrawable(R.drawable.ud_switch_d_btn_n);
		Button button = (Button)this.findViewById(btn);
		LinearLayout ll = (LinearLayout)this.findViewById(display);
		
		if(mark[index]){
			button.setBackgroundDrawable(down);
			ll.setVisibility(View.GONE);
			
		}else{
			button.setBackgroundDrawable(up);
			ll.setVisibility(View.VISIBLE);
		}
		mark[index] = !mark[index] ;
		
	}
	
}